/**
 * 系统主界面一进入系统后的第一个界面登录
 */
Ext.define('Jason.view.NewMain', {
    extend: 'Ext.container.Viewport',
    alternateClassName: 'mainView',
    xtype: 'mainView',
    requires: [
        'Wys.tree.List',
        'Wys.pane.LayoutTab',
        'Jason.view.main.Setting',
        'Jason.view.protal.authentication.LoginByForm',
        'Jason.view.protal.authentication.Register',
        'Wys.window.PullWindow',
        'Jason.store.NavigationTree',
        'Jason.view.*','Wys.*',
        'Jason.view.NewMainViewModel',
        'Jason.view.protal.dashboard.Dashboard',
        'Jason.view.protal.authentication.UserCenter',
        'Jason.view.NewMainCtrl'
    ],
    controller: 'newMainCtrl',
    viewModel: { type: 'newMainViewModel' },
    layout: {
        type: 'vbox',
        align: 'stretch'
    },
    items: [
        { xtype: 'app-header', reference: 'appHander' },
        {
            xtype: 'container',
            itemId : 'mainView',
            layout: 'border', 
            flex: 1,
            items: [{
                width: 200, xtype: 'panel', border: true,border:false,
                itemId: 'treePanel', height: '100%',autoScroll:true,
                region:'west',hidden:true,bind:{hidden:'{!isTreeMenu}'},
                items:[{
                    xtype: 'custom_treelist',collapsible:true,
                    itemId: 'dynamicTree',height: '100%',
                    expanderFirst: false,
                    expanderOnly: false,
                    singleExpand: true,
                    hideMode:'visibility',
                    listeners:{
                        selectionchange: 'onMenuSelectChange'
                    },
                    ui: 'navigation',
                    reference: 'dynamicTree'
                }]
            },{
                xtype: ((session.get('loginState') === undefined || session.get('loginState') === false))?'card-layout-panel':(localStorage.getItem('pageStyle')==='advanced')?'layoutTab':'card-layout-panel',
                region: 'center',
                itemId : 'appBody',
                reference: 'appBody',
                flex: 1,
                defaultTabs:[{
                    xtype : 'myDashboard',
                    routeId:'dashboard',
                    closable:false,
                    iconCls : 'fa-dashboard',
                    title:'首页'
                }]
            }]
        },
        { xtype: 'app-footer', hidden: !cfg.showCopyRight },
        {
            xtype: 'component',
            itemId: 'globalToast',
            floating: true, y: 10, shadow: false,
            hideMode: 'offsets',
            cls: 'global-toast',
            showAnimation: 'slideIn',
            html: ''
        }
    ]
})